home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / lib / mathlib / libfft / fft1 / init.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.5 KB  |  86 lines

  1. /* *****************************************************************************
  2. *
  3. * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
  4. * All Rights Reserved.
  5. *
  6. * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  7. * the contents of this file may not be disclosed to third parties, copied or
  8. * duplicated in any form, in whole or in part, without the prior written
  9. * permission of Silicon Graphics, Inc.
  10. *
  11. * RESTRICTED RIGHTS LEGEND:
  12. * Use, duplication or disclosure by the Government is subject to restrictions
  13. * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  14. * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  15. * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  16. * rights reserved under the Copyright Laws of the United States.
  17. *
  18. ***************************************************************************** */
  19. #include "fast.h"
  20. #include "event.h"
  21. #include "device.h"
  22.  
  23. extern void do_quit(), do_rightmouse(), do_resize(), display(), ShowFast();
  24. extern void dir_fft(), inv_fft(), add_noise();
  25. extern void add_box(), this_quit(), this_pow(), this_log();
  26. extern void size500_500(), size512_512(), size576_405();
  27.  
  28.  
  29. int mainmenu, quitmenu, sizemenu, realmenu, fouriermenu, fourier2menu;
  30.  
  31. extern int max_proc;
  32.  
  33. Init(name)
  34. char *name;
  35. {
  36.     prefsize(WIN_SIZE+WIN_RIGHT, WIN_SIZE);
  37.     {
  38.         char *t, *strrchr();
  39.         winopen((t=strrchr(name, '/')) != NULL ? t+1 : name);
  40.     }
  41.  
  42.     wintitle("2D FFT");
  43.  
  44.     add_event(ANY, REDRAW, ANY, display, NULL);
  45.     qdevice(REDRAW);
  46.     
  47.     add_event(ANY, ESCKEY, UP, do_quit, NULL);
  48.     qdevice(ESCKEY);
  49.  
  50.     add_event(ANY, WINQUIT, ANY, do_quit, NULL);
  51.     qdevice(WINQUIT);
  52.     
  53.     add_event(ANY, RIGHTMOUSE, DOWN, do_rightmouse, NULL);
  54.     qdevice(RIGHTMOUSE);
  55.  
  56.     doublebuffer();
  57.     RGBmode();
  58.     gconfig();
  59.  
  60.     cpack(oBLACK);
  61.     clear();
  62.     swapbuffers();
  63.  
  64.     CreateMenus();
  65.  
  66.     do_resize();
  67. }
  68.  
  69.     char str[64];
  70. CreateMenus() {
  71.     sizemenu = defpup(" Size %t| 512 x 512 %f| 500 x 500 %f| 576 x 405 %f",
  72.             size512_512, size500_500, size576_405);
  73.     realmenu = defpup(
  74. "XY Domain %t|Reset %f|Size %m|Add Noise %f|Add BOX %f|------|Direct FFT %f|------|Quit %f",
  75.         do_resize, sizemenu, add_noise, add_box, dir_fft, this_quit);
  76.  
  77.     fouriermenu = defpup(
  78. "FOURIER Domain %t|Reset %f|Size %m|Power Spectrum%f|Add Noise %f|------|Inverse FFT %f|------|Quit %f",
  79.         do_resize, sizemenu, this_pow, add_noise, inv_fft, this_quit);
  80.  
  81.     mainmenu = realmenu;
  82.  
  83.     quitmenu = defpup("Quit %t|Really %f|Cancel %f",
  84.             do_quit, ShowFast);
  85. }
  86.